import request from '@/utils/request';

// 查询字典数据列表
export function listData(query: any) {
    return request({
        url: '/tienchin/channel/list',
        method: 'get',
        params: query,
    });
}

// 调用课程分类下拉框的接口
export function listCourseType() {
    return request({
        url: '/system/dict/data/type/channel_type',
        method: 'get',
    });
}

// 调用使用人群得接口
export function getdictData() {
    return request({
        url: '/system/dict/data/type/channel_status',
        method: 'get',
    });
}

// 调用添加接口
export function addData(data: any) {
    return request({
        url: '/tienchin/channel',
        method: 'post',
        data: data,
    });
}

// 调用修改接口
export function updatePost(data: any) {
    return request({
        url: '/tienchin/channel',
        method: 'put',
        data
    });
}

// 通过id查询完整数据
export function getData(courseId: any) {
    return request({
        url: '/tienchin/channel/' + courseId,
        method: 'get'
    });
}

// 调用删除接口
export function delData(courseId:any) {
    return request({
        url: '/tienchin/channel/' + courseId,
        method: 'delete'
    });
}